package dao

import (
	"forum/app/post/internal/repository/db/model"
	"forum/pkg/util/logger"
)

func migration() {
	// 自动迁移模式
	err := _db.Set("gorm:table_options", "charset=utf8mb4").
		AutoMigrate(
			&model.Post{},
		)
	if err != nil {
		logger.LoggersObj.Infoln("register table failed")
		panic(err)
	}
	logger.LoggersObj.Infoln("register table success")
}
